package unit7;

import java.util.Scanner;

public class Test4 {

	public static void main(String[] args) {
		Scanner scanner = new Scanner(System.in);
		System.out.println("请输入您的5次存款数字：");
		double InputMoney[]=new double[5];
		double sum=0;
		double avg=0;
		
		
			for(int i=0;i<InputMoney.length-1;i++) {
			InputMoney[i]=scanner.nextDouble();}
			
			double max=InputMoney[0];
			double min=InputMoney[0];
			sum+=InputMoney[i];
			avg=sum/InputMoney.length;
			if (InputMoney[i]>max) {
				max=InputMoney[i];
				}
			if (InputMoney[i]<min) {
				min=InputMoney[i];
			}
		
			System.out.println("总和是："+sum);
			System.out.println("平均是："+avg);
			System.out.println("最大值是："+max);
			System.out.println("最小值是："+min);

	}

}
